<?php
class Feed
{
	
	private $FEED = "";
	
	function __construct()
	{
		$noteset = Note::load();
		
		$this->FEED = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
		$this->FEED .= "\n<feed>";
		
		foreach($noteset->getNotes() as $note)
		{
			$this->FEED .= "\n\t<note>";
			$this->FEED .= "\n\t\t<id>".$note->getId()."</id>";
			$this->FEED .= "\n\t\t<title>".$note->getTitle()."</title>";
			$this->FEED .= "\n\t\t<author>".$note->getAuthor()."</author>";
			$this->FEED .= "\n\t\t<creation>".$note->getCreationDate()."</creation>";
			$this->FEED .= "\n\t\t<modification>".$note->getModificationDate()."</modification>";
			$this->FEED .= "\n\t\t<excerpt>".$note->getExcerpt()."</excerpt>";
			$this->FEED .= "\n\t</note>";
		}
		
		$this->FEED .= "\n</feed>";
	}
	
	function getFeed()
	{
		return $this->FEED;
	}

	
}
?>